num=1
ret=0
for i in $(system/bin/ls /data/log/logcat_*.log)
do 
    num=$((num+1))
done

/system/bin/mkdir -p data/log

logcat -b radio -v time > /data/log/radio_${num}.log&
logcat -b events -v time > /data/log/events_${num}.log&
logcat -v time > /data/log/logcat_${num}.log&
cat /proc/wakelocks > /data/log/wakelocks_${num}.txt&
cat /proc/kmsg > /data/log/dmesg_${num}.log&

#add to init.rc:
# add log
#service log_recorder /system/bin/sh /system/bin/log_recorder.sh
#    class main
#    user root
#    oneshot
